﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TTEngine.AssetExt
{
    class Texture2DViewer : TTEditor.Resource.IAssetViewer
    {
        public uint AssetTypeID => AssetMgr.ID_Texture2D;

        public void OnGUI(IAsset asset)
        {
            var tex = asset as Texture2D;
            ImGuiNET.ImGui.Text("Texture2DViewer,这用来预览资源，需要Texture2Dpacker先把资源正确加载.");
            var texid = FakeUnity.Warp.FrameworkNative.Texture_GetImGuiTexID(tex.textureNative);
            ImGuiNET.ImGui.Image(texid, new System.Numerics.Vector2(256, 256));
        }
    }
}
